package org.opensource.webflux.quick;

import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.RouterFunction;
import org.springframework.web.reactive.function.server.RouterFunctions;

import javax.annotation.Resource;

import static org.springframework.web.reactive.function.server.RequestPredicates.GET;

@Component
public class HandleRouter {

    @Resource
    private TestHandler testHandler;

    @Bean
    public RouterFunction route() {
        return RouterFunctions.route(GET("/helloWorld"), testHandler::test);
    }
}
